<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" charset="utf-8">
        //call方法的简单模拟和实现
        function  test1(a, b) {
            return a+b;
        }

        /**
         * 自定义对象
         * @constructor
         */
        function Obj(x,y) {
            this.x = x;
            this.y = y;
            return x*y;
        }
        var obj = new Obj(10,20);
        //alert(test1.call(obj,obj.x,obj.y));
        //call方法的模拟
        obj.method = test1;
        alert(obj.method(obj.x,obj.y));
        delete obj.method;
    </script>
</head>
<body>
</body>
</html>